/**
 * 
 */
package com.faxsun.core.order.service;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.broadleafcommerce.core.order.domain.Order;
import org.broadleafcommerce.core.order.service.MergeCartServiceImpl;

import com.faxsun.core.order.service.type.FSOrderStatus;

/**
 * @author user
 *
 */
public class FSMergeCartServiceImpl extends MergeCartServiceImpl {

	@Override
    protected void setSavedCartAttributes(Order cart) {
        SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, ''yy");
        Date cartLastUpdated = cart.getAuditable().getDateUpdated();
        
        cart.setName("Previously saved cart - " + sdf.format(cartLastUpdated));
        cart.setStatus(FSOrderStatus.NAMED);
    }
}
